<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <title>User Details</title>
</head>
<body>
<h1>User Details</h1>
<form th:object="${user}" th:action="@{/users/{id}(id=${user.id})}" th:if="${user.id}" method="post">
  <input type="hidden" th:if="${user.id}" th:field="*{id}"/>
  <label>Name:</label>
  <input type="text" th:field="*{name}" />
  <br/>
  <label>Age:</label>
  <input type="text" th:field="*{age}" />
  <br/>
  <button type="submit">Save</button>
</form>
</body>
</html>